{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n",
      "2\n"
     ]
    }
   ],
   "source": [
    "import sys\n",
    "a = []\n",
    "#print(sys.getrefcount(a))\n",
    "\n",
    "def func(a):\n",
    "    print(sys.getrefcount(a))\n",
    "\n",
    "func(a)\n",
    "\n",
    "print(sys.getrefcount(a))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Graph written to C:\\Users\\18027\\AppData\\Local\\Temp\\objgraph-wbff5me5.dot (8 nodes)\n",
      "Image renderer (dot) not found, not doing anything else\n"
     ]
    }
   ],
   "source": [
    "import objgraph\n",
    "a = [1,2,3]\n",
    "b = [4,5,6]\n",
    "a.append(b)\n",
    "b.append(a)\n",
    "objgraph.show_refs([a],filename='./arefs.png')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
